rootfs_copy_core_image() {
    mkdir -p ${IMAGE_ROOTFS}/boot
    cp ${DEPLOY_DIR_IMAGE}/${DEF_DEVICETREE} ${IMAGE_ROOTFS}/boot/
}
rootfs_copy_core_image_lxqt() {
    mkdir -p ${IMAGE_ROOTFS}/boot
    mkdir -p ${IMAGE_ROOTFS}/copy
    cp ${DEPLOY_DIR_IMAGE}/Image ${IMAGE_ROOTFS}/boot/
    cp ${DEPLOY_DIR_IMAGE}/${DEF_DEVICETREE} ${IMAGE_ROOTFS}/boot/
    cp ${DEPLOY_DIR_IMAGE}/initrd.img ${IMAGE_ROOTFS}/boot/
    cp ${DEPLOY_DIR_IMAGE}/phytium-image-lxqt-${MACHINE}.tar.gz ${IMAGE_ROOTFS}/copy/
}

rootfs_copy_core_image_ubuntu() {
    mkdir -p ${IMAGE_ROOTFS}/boot
    mkdir -p ${IMAGE_ROOTFS}/copy
    cp ${DEPLOY_DIR_IMAGE}/Image ${IMAGE_ROOTFS}/boot/
    cp ${DEPLOY_DIR_IMAGE}/${DEF_DEVICETREE} ${IMAGE_ROOTFS}/boot/
    cp ${DEPLOY_DIR_IMAGE}/rootfs-ubuntu-desktop.tar.gz ${IMAGE_ROOTFS}/copy/
}

rootfs_ln_initrd() {
    cd ${DEPLOY_DIR_IMAGE}
    ln -sf  initrd.img.rootfs.cpio.gz  initramfs.img
}

rootfs_copy_initrd() {
    cd ${DEPLOY_DIR_IMAGE}
    mkdir -p ${IMAGE_ROOTFS}/boot
    cp ${DEPLOY_DIR_IMAGE}/initrd.img.rootfs.cpio.gz ${IMAGE_ROOTFS}/boot/initramfs.img
    cd ${IMAGE_ROOTFS}/boot/
    ln -sf initramfs.img initrd
}

rootfs_copy_initramfs_target() {
    rm -rf ${IMAGE_ROOTFS}/lib/systemd/system/default.target
    rm -rf ${IMAGE_ROOTFS}/lib/systemd/system/basic.target
    rm -rf ${IMAGE_ROOTFS}/lib/systemd/system/tmp.mount
    rm -rf ${IMAGE_ROOTFS}/etc/systemd/system/*
    cp ${IMAGE_ROOTFS}/lib/systemd/system/initrd.target ${IMAGE_ROOTFS}/lib/systemd/system/default.target
    cp ${IMAGE_ROOTFS}/etc/basic.targetconf ${IMAGE_ROOTFS}/lib/systemd/system/basic.target
}
